<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>VueComponent</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
    <div id="root">
        <school></school>
        <student></student>
    </div>
</body>
    <script type="text/javascript">
        Vue.config.productionTip = false

    
        const student =Vue.extend({ 
            name:'student',
            template:`
                <div>
                    <h2>{{studentName}}</h2>
                    <h2>{{studentAge}}</h2>
                    <button @click="showAlert">显示this的指向</button>     
                </div>
            `,
            data() {
                return {
                    studentName : '学员蒋',
                    studentAge : 22
                }
            },
             methods: {
                showAlert(){
                    console.log(this)
                }
            }
        })
        
        const school =Vue.extend({
            name:'school',
            template:`
                <div>
                    <h2>{{schoolName}}</h2>
                </div>
            `,
            data() {
                return {
                    schoolName : '家里蹲大学'
                }
            },
            components:{
                student
            }
        })
     

        const test=Vue.extend({

        })
        
        const vm= new Vue({
            el:'#root',
            data:{
              
            },
            computed:{
            //计算方法
            
            },
            methods:{
            //方法
            
            },
            filters:{
            //过滤器
            
            },
            components:{
                school,
                student
            }
        })
        </script>
    </html>
